<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>区域服务商列表</title>
		<link rel="stylesheet" href="__OEM__/css/iconfont.css" />
		<link rel="stylesheet" href="__OEM__/css/css.css" />
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right"><!--右侧内容-->
					<div class="rigtop" >
						<span class="title">区域服务商列表</span>					
					</div>
					<div class="indrig_con" style="position: relative;">
						{if $Think.session.user_level==1 && $Think.session.user_type==1}
						<div class="zizh_btnbox" style="top: -58px;right:30px">
							<button class="zizh_btn" type="button"><i class="iconfont icon-jia"></i>增加服务商</button>
						</div>
						{/if}
						<div class="zizh_conbox">
							<!--选项卡内容开始-->
							<div class="zizh_con_1">
								<div class="chax_conbox">
									<div class="chax_jiegnr">
										<table class="zizh_table1 zizh_table2">
											<thead>
												<tr>
													<th>代理名称</th>
													<th class="w_10">省服务商</th>
													<th>手机号</th>	
													<th>详细地址</th>
													<th>余额</th>
													<th>佣金</th>
													<th width="100px">鼓励金</th>
													<th width="120px">是否认证</th>
													<th width="120px">推广数</th>
													<th width="100px">状态</th>
													<th class="w_10">创建时间</th>
													<th>操作</th>
												</tr>
											</thead>
											<tbody id="tbody">
												{volist name="list" id="ad" empty="$empty"}
												<tr>
													<td>{$ad.user_name}</td>
													<td>{$ad.tname}</td>
													<td>{$ad.mobile}</td>
													<td>{$ad.addres}</td>	
													<td>
														<?php echo substr($ad['balance'],0,strlen($ad['balance'])-2)?>													
													</td>
													<td>
														<?php echo substr($ad['commission'],0,strlen($ad['commission'])-2)?>
													</td>
													<td>
														<?php echo substr($ad['score'],0,strlen($ad['score']))?>
													</td>
													<td>
														{if $ad.is_verify==1}
														是
														{else/}
														否
														{/if}
													</td>
													<td>{$ad.count?$ad.count : 0}</td>
													<td>
														{if $ad.status==1}
														正常
														{else/}
														冻结
														{/if}
													</td>
													<td>{$ad.add_time}</td>
													<td>
														<a onclick="open_edit('{$ad.id}')">编辑</a>
														{if $Think.session.user_level == 1}
															<a href="javascript:;" onclick="show_city_pt('{$ad.id}')" class="green" style="width: 65px;margin-top: 2px;">设置推荐人</a>
														{/if}
													</td>
												</tr>
												{/volist}
											</tbody>
										</table>
									</div>
									<div style="float: right;margin-top: 15px;">
										{$list->render()}
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}
		
	</body>
<script>
	$(".zizh_btn").click(function(){
				layer.open({
				  type: 2,
				  title: '增加服务商',
				  shadeClose: true,
				  shade: 0.8,
				  area: ['600px', '540px'],
				  content: "{:url('accounts/add_agency2')}"
				}); 
			})
			function open_edit(id){
				var url='edit_agency?id='+id;
				layer.open({
				  type: 2,
				  title: '编辑服务商',
				  shadeClose: true,
				  shade: 0.8,
				  area: ['500px', '450px'],
				  content:  [url]
				}); 
			}
			
			function show_city_pt(city_id){
			
				var show_url = "{:url('accounts/show_province_pt')}"+'?city_id='+city_id;
				
				layer.open({
					type: 2,
					title: '修改商家信息',
					shadeClose: true,
					shade: 0.8,
					area: ['460px', '260px'],
					content: show_url
				});
			}
</script>
</html>